import { getAuditorList, getAuditorButtonList } from '@/api/legal';
export default {
  data() {
    return {
    };
  },
  methods: {
    // 当类型为创建人和主管时，动态获取用户列表后，回填到 initDiyUserList
    _getAutitorList() {
      const params = {
        examineRoleId: this.examineRoleId,
        isAllowSelectOther: true,
        name: '',
        page: 1,
        perPage: 50
      };
      if (this.extendParams) {
        Object.keys(this.extendParams).forEach(key => {
          params[key] = this.extendParams[key];
        });
      }
      const getUser = this.getUserList();
      getUser(params).then(res => {
        if (res.code === 200 && res.data.items) {
          this.initAuditorList = res.data.items;
        }
      });
    },
    getUserList() {
      const isSubmitBtn = this.isSubmitBtn;
      if (!isSubmitBtn) {
        return getAuditorList;
      } else {
        return getAuditorButtonList;
      }
    }
  }
};
